home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / XML Utilities / Professional Programmer XSL IDE / Xselerator25.msi / Data.Cab / F44536_numberutils_test.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2002-03-07  |  3.5 KB  |  108 lines

  1. <?xml version="1.0"?>
  2. <!-- run this stylesheet with any input XML -->
  3. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  4. <xsl:output method="html" indent="yes" encoding="ISO-8859-1"/>
  5. <xsl:include href="numberutils_lib.xsl"/>
  6. <xsl:template match="/">
  7.   <html>
  8.     <head/>
  9.     <body>
  10.       <h3>XSLT Number Utils Test Page</h3>
  11.       <table border="1" width="80%" align="center">
  12.         <tr>
  13.           <th width="50%">Conversion/Expression</th>
  14.           <th width="50%">Result</th>
  15.         </tr>
  16.         <tr>
  17.           <td>Binary 110100011 to Decimal</td>
  18.           <td>
  19.             <xsl:call-template name="Bin2Dec">
  20.               <xsl:with-param name="value" select="'110100011'"/>
  21.             </xsl:call-template>
  22.           </td>
  23.         </tr>
  24.         <tr>
  25.           <td>Binary 110100011 to Hexadecimal</td>
  26.           <td>
  27.             <xsl:call-template name="Dec2Hex">
  28.               <xsl:with-param name="value">
  29.                 <xsl:call-template name="Bin2Dec">
  30.                   <xsl:with-param name="value" select="'110100011'"/>
  31.                 </xsl:call-template>
  32.               </xsl:with-param>
  33.             </xsl:call-template>
  34.           </td>
  35.         </tr>
  36.         <tr>
  37.           <td>Hexadecimal $1A3 to Decimal</td>
  38.           <td>
  39.             <xsl:call-template name="Hex2Dec">
  40.               <xsl:with-param name="value" select="'1A3'"/>
  41.             </xsl:call-template>
  42.           </td>
  43.         </tr>
  44.         <tr>
  45.           <td>Hexadecimal $1A3 to Binary</td>
  46.           <td>
  47.             <xsl:call-template name="Dec2Bin">
  48.               <xsl:with-param name="value">
  49.                 <xsl:call-template name="Hex2Dec">
  50.                   <xsl:with-param name="value" select="'1A3'"/>
  51.                 </xsl:call-template>
  52.               </xsl:with-param>
  53.             </xsl:call-template>
  54.           </td>
  55.         </tr>
  56.         <tr>
  57.           <td>Decimal 419 to Hexadecimal</td>
  58.           <td>
  59.             <xsl:call-template name="Dec2Hex">
  60.               <xsl:with-param name="digits" select="number(4)"/>
  61.               <xsl:with-param name="value" select="number(419)"/>
  62.             </xsl:call-template>
  63.           </td>
  64.         </tr>
  65.         <tr>
  66.           <td>Decimal 419 to Binary</td>
  67.           <td>
  68.             <xsl:call-template name="Dec2Bin">
  69.               <xsl:with-param name="value" select="number(419)"/>
  70.             </xsl:call-template>
  71.           </td>
  72.         </tr>
  73.         <tr>
  74.           <td colspan="2"></td>
  75.         </tr>
  76.         <tr>
  77.           <td>419 AND 255</td>
  78.           <td>
  79.             <xsl:call-template name="BooleanAND">
  80.               <xsl:with-param name="value1" select="number(419)"/>
  81.               <xsl:with-param name="value2" select="number(255)"/>
  82.             </xsl:call-template>
  83.           </td>
  84.         </tr>
  85.         <tr>
  86.           <td>419 OR 255</td>
  87.           <td>
  88.             <xsl:call-template name="BooleanOR">
  89.               <xsl:with-param name="value1" select="number(419)"/>
  90.               <xsl:with-param name="value2" select="number(255)"/>
  91.             </xsl:call-template>
  92.           </td>
  93.         </tr>
  94.         <tr>
  95.           <td>419 XOR 255</td>
  96.           <td>
  97.             <xsl:call-template name="BooleanXOR">
  98.               <xsl:with-param name="value1" select="number(419)"/>
  99.               <xsl:with-param name="value2" select="number(255)"/>
  100.             </xsl:call-template>
  101.           </td>
  102.         </tr>
  103.         
  104.       </table>
  105.     </body>
  106.   </html>
  107. </xsl:template>
  108. </xsl:stylesheet>